The mean of a discrete random variable X with probability mass function P(x) is
μ = ∑xxP(x)
and its variance
σ2 = ∑(x − μ)2P(x)